

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="zh-CN" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="zh-CN" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>版本号管理 &mdash; WeIdentity  文档</title>
  

  
  
  
  

  

  
  
    

  

  <link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/theme_overrides.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/index.css" type="text/css" />
    <link rel="index" title="索引" href="../../genindex.html" />
    <link rel="search" title="搜索" href="../../search.html" /> 

  
  <script src="../../_static/js/modernizr.min.js"></script>

</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">

    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search">
          

          
            <a href="../../index.html" class="icon icon-home"> WeIdentity
          

          
          </a>

          
            
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <p class="caption"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../README.html">什么是 WeIdentity？</a></li>
<li class="toctree-l1"><a class="reference internal" href="../one-stop-experience.html">WeIdentity 一站式体验</a></li>
<li class="toctree-l1"><a class="reference internal" href="../terminologies.html">术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../use-cases.html">使用场景</a></li>
<li class="toctree-l1"><a class="reference internal" href="../weidentity-spec.html">WeIdentity 规范</a></li>
<li class="toctree-l1"><a class="reference internal" href="../weidentity-installation.html">WeIdentity Java SDK 安装部署</a></li>
<li class="toctree-l1"><a class="reference external" href="https://weidentity.readthedocs.io/projects/javasdk/zh_CN/latest/">WeIdentity Java SDK 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../weidentity-sample.html">WeIdentity Sample 开发样例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../miscellaneous.html">杂项</a></li>
<li class="toctree-l1"><a class="reference internal" href="../faq.html">FAQ</a></li>
<li class="toctree-l1"><a class="reference internal" href="../weidentity-rest.html">WeIdentity RestService</a></li>
<li class="toctree-l1"><a class="reference internal" href="../weidentity-endpoint.html">WeIdentity Endpoint Service</a></li>
<li class="toctree-l1"><a class="reference internal" href="../weidentity-contract-design.html">WeIdentity 智能合约设计与实现</a></li>
</ul>

            
          
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../index.html">WeIdentity</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../index.html">Docs</a> &raquo;</li>
        
      <li>版本号管理</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            <a href="../../_sources/docs/styleguides/versioning-management.md.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="">
<span id="id1"></span><h1>版本号管理<a class="headerlink" href="#" title="永久链接至标题">¶</a></h1>
<p>我们的版本号管理遵循 <a class="reference external" href="https://semver.org/">Semantic Versioning 2.0.0</a>；
例如 v1.2.3，<code class="docutils literal notranslate"><span class="pre">MAJOR</span></code> 版本号是<code class="docutils literal notranslate"><span class="pre">1</span></code>，<code class="docutils literal notranslate"><span class="pre">MINOR</span></code> 版本号是2，<code class="docutils literal notranslate"><span class="pre">PATCH</span></code> 版本号是3；</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">MAJOR</span></code> 版本号的变更可能会出现不兼容的 API 改变或者升级。</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">MINOR</span></code> 版本号变更会添加新 feature，同时保证向后兼容性。</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">PATCH</span></code> 版本号变更主要是用于 bug 修复，同时保证向后兼容性。</p></li>
</ul>
<div class="section" id="sdk">
<span id="sdk"></span><h2>SDK或者智能合约使用过程中的升级问题<a class="headerlink" href="#sdk" title="永久链接至标题">¶</a></h2>
<p>如果WeIdentity使用过程中遇到了 bug，需要升级，可能会出现下面的几种情况：</p>
<p>SDK 搭配智能合约运行了一段时间，发现一些 bug，解决方案可能会出现下面的几种情况：</p>
<ol>
<li><p>SDK 需要升级，智能合约不升级。如果 SDK 已经有版本修复了这个 bug，并且 SDK 的版本号只有 <code class="docutils literal notranslate"><span class="pre">MINOR</span></code> 和 <code class="docutils literal notranslate"><span class="pre">PATCH</span></code> 版本号跟当前使用的 SDK 不一致，因为这类 SDK 的升级保证了向后兼容性，从而肯定能兼容当前使用的智能合约，所以可以直接升级 SDK。例如使用 <code class="docutils literal notranslate"><span class="pre">weid-java-sdk-v1.2.3</span></code> 的过程中遇到了 bug，然后这个 bug 在 <code class="docutils literal notranslate"><span class="pre">weid-java-sdk-v1.3.0</span></code> 版本中得到了修复，则可以直接升级。</p>
<blockquote>
<div><p>注意:
如果这个时候没有找到向后兼容的 SDK 升级版本,例如使用 <code class="docutils literal notranslate"><span class="pre">weid-java-sdk-v1.2.3</span></code> 的过程中遇到了 bug, 然后这个 bug 在 <code class="docutils literal notranslate"><span class="pre">weid-java-sdk-v2.0.1</span></code> 版本得到了修复，这个时候如果升级SDK，可能会遇到接口不兼容或者不兼容当前使用的智能合约版本的情况。这个时候可以给我们提 issue，我们可以提供特定的 bugfix 版本。</p>
</div></blockquote>
</li>
<li><p>SDK 不需要升级，智能合约需要升级。合约的升级同样满足版本号管理的约束，例如当前使用的 <code class="docutils literal notranslate"><span class="pre">weid-contract-v1.4.0</span></code> 有 bug，然后这个bug在 <code class="docutils literal notranslate"><span class="pre">weid-contract-v1.5.2</span></code> 版本中得到了修复。则可以直接升级合约。</p></li>
<li><p>SDK 和智能合约都需要升级。这种情况建议两者都升级到最新的 release 版本，最新版本的 SDK 一定兼容最新版本的智能合约。</p></li>
</ol>
</div>
</div>


           </div>
           
          </div>
          <footer>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; Copyright (2018) WeBank Co., Ltd.

    </p>
  </div>
  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  


  

    
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/jquery.js"></script>
        <script src="../../_static/underscore.js"></script>
        <script src="../../_static/doctools.js"></script>
        <script src="../../_static/language_data.js"></script>
        <script src="../../_static/translations.js"></script>
    

  

  <script type="text/javascript" src="../../_static/js/theme.js"></script>

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>